// packageD/member/component/rated/rated.js
const skinBehavior = require('../../../../utils/themeSkin/skinBehavior');
Component({
  behaviors: [skinBehavior],
  /**
   * 组件的属性列表
   */
  options: {  //小程序获取外部样式
    addGlobalClass: true,
  },
  properties: {
    commList: {
      type:Array,
      value:[]
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    opration(e) {
      let btn = e.target.dataset.btn;
      let item = e.target.dataset.good;
      //value-1 追加评价value-2 查看评价详情
      if (btn && btn.value == 1) {
        //addevaluate
        wx.navigateTo({
          url: `/packageD/member/addevaluate/addevaluate?order_id=${item.order.id}&goods_id=${item.goods_id}&id=${item.id}`
        });
        
      } else {
        //CommentDetails
        let options = `order_id=${item.order.id}&goods_id=${item.goods_id}&comment_id=${item.has_one_comment.id}&order_goods_id=${item.id}`
        wx.navigateTo({
          url: '/packageD/member/CommentDetails/CommentDetails?' + options
        });
  
      }
    },
  }
})
